﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ColorApplication.FileManager
{
    public partial class FileManagerForEditor : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateFileManager();
            Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetNoStore();

            //to set default path for first time
            if (!IsPostBack)
                ScriptManager.RegisterClientScriptBlock(this.Page, typeof(Page), "setCurrentPath", "CurentPath='" + ConfigurationManager.AppSettings["FileManager"].ToString() + "'", true);
        }

        // change this funcation if you want to create your Authenticate 
        public void AuthenticateFileManager()
        {

            /* Edit this funcation to  AuthenticateFileManager*/
            string SessionID = Request["sessionid"].ToString();

            if (Request.Cookies[SessionID] != null)
            {

            }
            else
            {
                Response.Clear();
                Response.Write("Access Denied");
                Response.End();
            }

        }
    }
}